#{extends 'admin.html' /}
    #{ifnot post?.id}
    <h3>
    Write <span>a new post</span>
    </h3>
    #{/ifnot}
    #{else}
    <h3>Edit, <span>this post</span></h3>
    #{/else}
    
#{form @save(post?.id)}
    #{ifErrors}
    <p class="error">
        Please correct these errors.
    </p>
    #{/ifErrors}
    
    <p>
        #{field 'title'}
        <label>
            Post title:
        </label>
        <input type="text" name="${field.name}" value="${post?.title}"/>
        <span class="error">
            #{error 'post.title'/}
        </span>
        #{/field}
    </p>
    
    <p>
        #{field 'content'}
        <label>Write here:</label>
        <textarea name ="${field.name}">${post?.content}</textarea>
        <span class="error">#{error 'post.content' /}</span>
        #{/field}
    </p>
    
    <p>
        #{field 'tags'}
        <label>Enter some tags:</label>
        <input type="text"  size="50"    name="${field.name}"    value="${post?.tags?.join(' ')}"/>
        #{/field}
    </p>
    
    <p>
        <input type="submit"    value="Publish this post to the blog" />
            
    </p>
    #{/form}